package com.unidt.www.module.third.doc.utils;

import com.spire.doc.Document;
import com.spire.doc.FileFormat;

/**
 * @Author sk
 * @Description:
 * @Date 2022/11/24 17:18
 **/

public class HtmlUtils {

    /**
     * 功能描述: 保存为HTML
     * @author sk
     * @date 2022/12/10
     * @param path
     * @param targetPath
     * @return java.lang.Boolean
     */

    public static Boolean saveToHtml(String path,String targetPath) {
        try {
            Document doc = new Document();
            doc.loadFromFile(path);
            doc.saveToFile(targetPath, FileFormat.Html);
            doc.dispose();
            return true;
        }catch (Exception e){
            e.printStackTrace();
        }
        return false;


    }


    public static void main(String[] args) {
        String path = "D://tmp/浙江省生产制造方式转型示范项目计划项目申报书.docx";
        String  htmlPath = "D://tmp/1213.html";
        saveToHtml(path,htmlPath);

    }
}
